﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using DAL.Models;
using Microsoft.EntityFrameworkCore;
namespace DAL.Dao
{
    public  class DbEntity
    {
        public static DbContextOptions<ExpressDBContext> DBContextOptions { get; private set; }
        //public static void Dispose(){
        //    if (DBContext != null)
        //    {
        //        DBContext.Dispose();
        //    }

        //}
        public static void BindContext(ExpressDBContext _expressDBContext, DbContextOptions<ExpressDBContext> _dbContextOptions)
        {
            DBContextOptions = _dbContextOptions;
        }
        //public static void CheckConn()
        //{
        //    if (DbEntity.DBContext == null) DbEntity.DBContext = new ExpressDBContext();
        //    //else if (DbEntity.DBContext.Database.CurrentTransaction. == ConnectionState.Closed) DbEntity.DBContext.Database.Connection.Open();
        //}
    }
}
